package mc.support.service.common;

import com.taobao.api.domain.Item;

import java.util.List;

/**
 * Created with IntelliJ IDEA. <br/>
 * Author: francis Yun    <br/>
 * Date: 2013-11-23  <br/>
 */

public interface ICacheService {

    public boolean writeObjectToCache(Object obj, String key);

    public boolean writeObjectToCache(Object obj, String key, int expireSec);

    public boolean writeItemsToCache(List<Item> items, String key);

    public boolean writeItemsToCache(List<Item> items, String key, int expireSec);

    public void registerKeyToDel(String subject, String key);

    public boolean delKeysBySubject(String subject);

    public boolean delKey(String key);

    public Object readObjectFromCache(String key);

    public List<Item> readItemsFromCache(String key);

    public String generateCacheKey(Class<?> clazz, String... subjects);

    public boolean isCached(String cachedKey);

}
